﻿@model IEnumerable<Citi.EmailSender.WebUi.Models.EmailDataModel>

@{
    ViewBag.Title = "Templates";
}

<h2>Templates</h2>

<p>
    @Html.ActionLink("Create New", "Create", null, new { @class = "btn btn-primary" })
</p>
<table class="table table-bordered table-striped"> 
    <tr>
        <th>
            Application Unique Key
        </th>
        <th>
            Application
        </th>
        <th>
            On Behalf Of
        </th>
        <th>
            Url
        </th>
        <th>
            Subject
        </th>
        <th>
            Importance
        </th>
        <th>
            Application Key
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ApplicationUniqueKey)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Application.FullName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OnBehalfOf.FriendlyName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Url)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Subject)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Importance)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ApplicationKey)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Preview", "Preview", new { id = item.Id}, new { target = "_blank" }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
